package com.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.entity.Permissions;
import com.entity.UserRole;

public interface RoleMapper {
	 int deleteByPrimaryKey(Long id);

	    int insert(UserRole record);

	    UserRole selectByPrimaryKey(Long id);

	    List<UserRole> selectAll();

	    int updateByPrimaryKey(UserRole record);
	    
	    //获取所有包括一级二级 zTree
	    List<Permissions> selectRolePermissions(@Param("id") Long id);
	    
	    //通过关联关系获取
	    List<Permissions> selectPermissionsByRoleId(@Param("pid")Long pid ,@Param("id") Long id);
	    
	    int deletePermissByRoleId(Long id);
	    
	    int addRolePermiss(@Param("roleId") Long roleId,@Param("permIds") Long [] permIds);

}
